home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "TileBitMap"
- Option Explicit
- Public Sub TilePicture(frmDest As Form, picSource As PictureBox)
-
- Dim iPicWidth As Integer
- Dim iPicHeight As Integer
- Dim iFormWidth As Integer
- Dim iFormHeight As Integer
- Dim x As Integer
- Dim y As Integer
- Dim iResult As Integer
- Dim iOldScale As Integer
-
- ' Get the picture width and height in pixels
- iOldScale = picSource.ScaleMode
- picSource.ScaleMode = 3
- iPicWidth = picSource.ScaleWidth
- iPicHeight = picSource.ScaleHeight
- picSource.ScaleMode = iOldScale
-
- 'Get the Forms width and height in pixels
- iFormWidth = frmDest.Width / Screen.TwipsPerPixelX
- iFormHeight = frmDest.Height / Screen.TwipsPerPixelY
-
- For x = 0 To iFormWidth Step iPicWidth
-
- For y = 0 To iFormHeight Step iPicHeight
-
- iResult = BitBlt(frmDest.hdc, x, y, iPicWidth, iPicHeight, _
- picSource.hdc, 0, 0, SRCCOPY)
-
- Next
-
- Next
-
- End Sub
-